package com.xuelang.pipeline.artifact.client.resource.enums;

import lombok.Getter;

/**
 * 制品工具枚举类
 *
 * @author xiwen.zxg
 * @since 2024/6/27
 */
@Getter
public enum Nexus3V1Enum {

    ;
    /**
     * 仓库格式枚举类
     */
    public enum RepositoryFormatEnum {
        /**
         * apt
         */
        apt("apt"),
        /**
         *  bower
         */
        bower("bower"),
        /**
         * cocoapods
         */
        cocoapods("cocoapods"),
        /**
         * conan
         */
        conan("conan"),
        /**
         * docker
         */
        docker("docker"),
        /**
         * gitlfs
         */
        gitlfs("gitlfs"),
        /**
         * go
         */
        go("go"),
        /**
         * helm
         */
        helm("helm"),
        /**
         * maven2
         */
        maven2("maven2"),
        /**
         * npm
         */
        npm("npm"),
        /**
         * nuget
         */
        nuget("nuget"),
        /**
         * p2
         */
        p2("p2"),
        /**
         * pypi
         */
        pypi("pypi"),
        /**
         * r
         */
        r("r"),
        /**
         * raw
         */
        raw("raw"),
        /**
         * rubygems
         */
        rubygems("rubygems"),
        /**
         * yum
         */
        yum("yum")
        ;

        /**
         * key
         */
        private final String key;


        RepositoryFormatEnum(String key) {
            this.key = key;
        }

        public static boolean isValid(String roleName) {
            for (RepositoryFormatEnum item : RepositoryFormatEnum.values()) {
                if (item.key.equals(roleName)) {
                    return true;
                }
            }
            return false;
        }

    }

}
